# 提供给其它项目引用的共享资源(如果想通过框架构建引用的话）
if(FRAMEWORK_WANT_INCLUDE)

    if(feature_plugin)
        list(APPEND FRAMEWORK_INCLUDE_EXPORTS      # 共享的引用目录
            ${CMAKE_CURRENT_LIST_DIR}/plugins/include/
        )
        list(APPEND FRAMEWORK_SOURCES_EXPORTS      # 共享的资源文件
            ${CMAKE_CURRENT_LIST_DIR}/plugins/include/extensions.h
        )
        # 在被引用时，提供插件测试能力
        if(NOT TARGET ${FRAMEWORK_PLUGIN}-test)
            spark_add_executable_path(${FRAMEWORK_PLUGIN}-test
                ${CMAKE_CURRENT_LIST_DIR}/plugins/include
                ${CMAKE_CURRENT_LIST_DIR}/resources.qrc

                ${CMAKE_CURRENT_LIST_DIR}/
                ${CMAKE_CURRENT_LIST_DIR}/src
                ${CMAKE_CURRENT_LIST_DIR}/src/loader
                ${CMAKE_CURRENT_LIST_DIR}/src/ui
                ${CMAKE_CURRENT_LIST_DIR}/src/ui/widgets
                ${CMAKE_CURRENT_LIST_DIR}/src/ui/widgets/animationicon
                ${CMAKE_CURRENT_LIST_DIR}/src/ui/widgets/animationtext
                ${CMAKE_CURRENT_LIST_DIR}/src/utils
            )
            spark_framework_include_with_git(${FRAMEWORK_PLUGIN}-test
                https://gitee.com/spark-framework-libs/spark-framework-features
                FEATURES version baseutil screenutil
            )
            target_link_qt(${FRAMEWORK_PLUGIN}-test)
            target_compile_definitions(${FRAMEWORK_PLUGIN}-test PRIVATE ZTBOX_TEST_PLUGINS="$<TARGET_FILE:${FRAMEWORK_PLUGIN}>")
        endif()
    endif(feature_plugin)

    set(FRAMEWORK_WITHGIT_EXPORTS      # 共享的引用构建资源
        # 1. 引用了公共存储库
        # https://gitee.com/ndd-community/framework-plugin-component-library

        # 2. 引用了该项目提供的 - 间接引用 QFtp
        # https://gitee.com/spark-framework-libs/QFtpExample
        # https://gitee.com/spark-framework-libs/QFtp

        # 3. 引用了该项目提供的 Drag/Drop Eaters 与 EventUtil
        # https://gitee.com/zinface/notepad--plugin.image-view
    )

    # 特殊构建 - 为引用资源的目标配置预期所需依赖的构建
        # FRAMEWORK_PLUGIN 引用本资源的框架目标变量
    # find_package(Qt5Svg)
    # target_link_libraries(${FRAMEWORK_PLUGIN} Qt5::Svg)

    # 5. 扩展库将安装到指定位置
    if(FEATURE_plugin_install)
        install(TARGETS ${FRAMEWORK_PLUGIN}
            DESTINATION lib/zToolsBox/plugins)
    endif(FEATURE_plugin_install)

    return()
endif(FRAMEWORK_WANT_INCLUDE)
